package client

import (
	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/canvas"
	"fyne.io/fyne/v2/container"
	"fyne.io/fyne/v2/widget"
)

func (la *LocalApp) BuildWelcome() fyne.Window {
	window := la.app.NewWindow("欢迎")

	//style := widget.NewLabelWithStyle("欢迎使用聊天系统", fyne.TextAlignCenter, fyne.TextStyle{})
	style := canvas.NewText("欢迎使用聊天系统", HEXToColorNRGBA("00BFFF"))
	style.Alignment = fyne.TextAlignCenter

	button1 := widget.NewButton("登录", func() {
		la.loginWindow = la.BuildLogin()
		la.loginWindow.Show()
	})
	button2 := widget.NewButton("注册", func() {
		la.registerWindow = la.BuildRegister()
		la.registerWindow.Show()
	})

	box := container.NewGridWithColumns(2, button1, button2)
	mainC := container.NewBorder(nil, box, nil, nil, style)

	window.SetContent(mainC)
	return window
}
